package com.zxx.pattern.mediatorPattern.mediator3;

/**
 * @author zxx on 2021/5/11
 */
public class ColleagueCPU extends Colleague {

    private String dataVideo, dataSound;

    public ColleagueCPU(Mediator3 mediator) {
        super(mediator);
    }

    public String getDataVideo() {
        return dataVideo;
    }

    public String getDataSound() {
        return dataSound;
    }

    public void decodeData(String data) {
        //分割音视频
        String[] tmp = data.split(",");
        dataVideo = tmp[0];
        dataSound = tmp[1];

        //通知中介者 自身状态的变化
        mediator.changed(this);
    }
}
